package main

import (
	"fmt"
	"regexp"
)

const text = `My email is guohao@163.com
email2 is ccc@qq.com
email3 is test@163.com.cn
email4 is guohao@126.com.cn
`

func main() {
	re := regexp.MustCompile(`([a-zA-Z0-9]+)@([a-zA-Z0-9.]+)\.([a-zA-Z0-9]+)`)
	match := re.FindAllStringSubmatch(text, -1)
	for _, match := range match {
		for _, s := range match {
			fmt.Println(s)
		}
	}
}
